<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">菜单管理</div>
                </div>
                <div class="widget-body am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <a href="javascript:;" class="ajax am-btn am-btn-default am-btn-success am-radius "
                                            data-height="500"
                                            data-width="600"
                                       data-uri="<?=url('menus/add')?>"
                                    >
                                        <span class="am-icon-plus "  ></span> 新增
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>菜单ID</th>
                                <th>菜单名称</th>
                                <th>菜单图标</th>
                                <th>菜单类型</th>
                                <th>菜单状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if(!empty($list)) : foreach($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="am-text-middle">
                                        <p class="item-title"><?= $item['title'] ?></p>
                                    <td class="am-text-middle"> <i class="iconfont sidebar-nav-link-logo <?= $item['icon'] ?>"
                                                                   style="<?= isset($item['color']) ? "color:{$item['color']};" : '' ?>"></i></td>
                                    <td class="am-text-middle">
                                         <i class="fa fa-<?= $item['type'] ?>" aria-hidden="true"></i>
                                    </td>

                                    <td >
                                         <div data-tdtype="toggle" data-acturi="<?=url(request()->controller().'/ajax_edit')?>" data-id="{{$item.id}}" data-field="status" data-value="{{$item.status}}" class="am-text-middle">
                                        <?php if($item['status']==1) :?>
                                        <i class="fa fa-eye" aria-hidden="true"></i>&nbsp&nbsp<?= __('Normal');?>
                                        <?php ; else : ?>
                                        <i class="fa fa-eye-slash" aria-hidden="true"></i>&nbsp&nbsp<?= __('Hidden');?>
                                        <?php  endif; ?>
                                         </div>
                                    </td>

                                    </td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="javascript:;" class="ajax" data-title="{{:__('add_child')}}"
                                               <?php if($item['is_windows'] ==1):?>
                                               data-height="400<?=$item['height']?>"
                                               data-width="500<?=$item['width']?>"
                                               <?php endif ;?>
                                               data-uri="<?=url('menus/add','pid='.$item['id'])?>">
                                                <i class="fa fa-paint-brush"></i> <?= __('add_child')?>
                                            </a>
                                            <a href="javascript:;" class="ajax" data-title="{{:__('edit')}}"
                                                <?php if($item['is_windows'] ==1):?>
                                                    data-height="400<?=$item['height']?>"
                                                    data-width="500<?=$item['width']?>"
                                                <?php endif ;?>
                                               data-uri="<?=url('menus/edit','id='.$item['id'])?>">
                                                <i class="am-icon-pencil"></i><?= __('edit')?>
                                            </a>
                                            <a href="javascript:;" class="delete tpl-table-black-operation-del"
                                               data-id="<?= $item['id'] ?>"  data-uri="<?=url('menus/delete')?>">
                                                <i class="am-icon-trash"></i> {{:__('delete')}}
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>

                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">

                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        // 删除元素
        var url = "<?= url('goods/delete') ?>";
        $('.item-delete').delete('goods_id', url);

    });
</script>


